<template>
  <el-container class="home_container">
    <!-- 头部区域 -->
    <el-header>
      <div>
        <img src="../../assets/logo.png" alt="" class="adminLogo" />
        <span>VideosTV后台</span>
      </div>
      <el-button type="primary" @click="logout">退出</el-button>
    </el-header>
    <!-- 页面主体区域 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="200px" style="background: purple">
        <el-menu :router="true">
          <el-menu-item index="/admin/user">
            <el-icon><User /></el-icon>
            <span>用户管理</span>
          </el-menu-item>
          <el-menu-item index="/admin/video">
            <el-icon><VideoPlay /></el-icon>
            <span>视频管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!-- 右侧内容主体 -->
      <el-main style="background: skyblue">
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";

const router = useRouter();

const menulist = ref([]);

const logout = () => {
  window.sessionStorage.clear();
  router.push("/login");
};
const getMenuList = () => {
  //   API.get("");
};
</script>

<style lang="less" scoped>
.home_container {
  height: 100%;
}
.adminLogo {
  width: 50px;
}
.el-header {
  display: flex;
  justify-content: space-between;
  padding-left: 0;
  border-bottom: 1px solid #000;
  align-items: center;
  font-size: 20px;
  > div {
    display: flex;
    align-items: center;
    span {
      margin-left: 15px;
    }
  }
}
</style>
